package com.mrgood;

import com.mrgood.config.Context;
import com.mrgood.rest.ServiceC;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.openfeign.EnableFeignClients;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@EnableFeignClients
@SpringBootApplication
public class SvcB {
    private Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    ServiceC serviceC;

    public static void main(String[] args) {
        SpringApplication.run(SvcB.class, args);
    }

    @GetMapping("/pathb/b")
    public String get() {
        Context context = new Context();
        context.mark("svc-b", "0.6");
        return context.push(serviceC.get1());
    }
}
